﻿<%@ Page Title="Platos" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeBehind="platos.aspx.cs" Inherits="Restaurante.platos"%>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
         <p id="titulo"> Platos </p>
    </h2>
    <div class="contTabla">
        <asp:GridView ID="gvPlatos" runat="server" AutoGenerateColumns="False" 
            CellPadding="4" ForeColor="#333333" GridLines="None" AllowSorting="True" 
            DataKeyNames="Id_Plato" DataSourceID="PlatosGrilla" AllowPaging="True">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
                    ShowSelectButton="True" />
                <asp:BoundField DataField="Id_Plato" 
                    HeaderText="Id_Plato" InsertVisible="False" ReadOnly="True" 
                    SortExpression="Id_Plato" />
                <asp:BoundField DataField="descripcion" 
                    HeaderText="descripcion" SortExpression="descripcion" />
                <asp:BoundField DataField="tamanio" 
                    HeaderText="tamanio" SortExpression="tamanio" />
                <asp:BoundField DataField="valor" HeaderText="valor" SortExpression="valor" />
            </Columns>
            <EditRowStyle BackColor="#2461BF" />
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#EFF3FB" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F5F7FB" />
            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
            <SortedDescendingCellStyle BackColor="#E9EBEF" />
            <SortedDescendingHeaderStyle BackColor="#4870BE" />
        </asp:GridView>
        <asp:SqlDataSource ID="PlatosGrilla" runat="server" 
            ConnectionString="<%$ ConnectionStrings:BarCafe %>" 
            DeleteCommand="DELETE FROM [descripcion] WHERE [Id_Plato] = @Id_Plato" 
            InsertCommand="INSERT INTO [descripcion] ([descripcion], [tamanio], [valor]) VALUES (@plato, @tamanio, @valor)" 
            ProviderName="<%$ ConnectionStrings:BarCafe.ProviderName %>" 
            SelectCommand="SELECT * FROM [Plato]" 
            
            UpdateCommand="UPDATE [Plato] SET [plato] = @plato, [tamanio] = @tamanio, [valor] = @valor WHERE [Id_Plato] = @Id_Plato">
            <DeleteParameters>
                <asp:Parameter Name="Id_Plato" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="plato" Type="String" />
                <asp:Parameter Name="tamanio" Type="String" />
                <asp:Parameter Name="valor" Type="Int64" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="descripcion" Type="String" />
                <asp:Parameter Name="tamanio" Type="String" />
                <asp:Parameter Name="valor" Type="Int64" />
                <asp:Parameter Name="Id_Plato" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
    </div>
    <span class="failureNotification">
                <asp:Literal ID="FailureText" runat="server"></asp:Literal>
    </span>
    <div class="contTabla">
        <table>
        <tr>
            <td class="style1">                
                <asp:Label ID="Label1" runat="server" AssociatedControlID="Descrip">Ingrese la Descripción:</asp:Label>
            </td>
            <td>
               <asp:TextBox ID="Descrip" runat="server" MaxLength="50" ></asp:TextBox>
               <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="Descrip" 
                CssClass="failureNotification" ErrorMessage="La descripción es obligatorio." ToolTip="La descripción es obligatorio." 
                ValidationGroup="LoginUserValidationGroup">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="style1">
                <asp:Label ID="Label2" runat="server" AssociatedControlID="txtTamano">Ingrese el tamaño:</asp:Label>
            </td>
            <td>
               <asp:TextBox ID="txtTamano" runat="server" MaxLength="15" ></asp:TextBox>
               <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtTamano" 
                CssClass="failureNotification" ErrorMessage="El tamaño es obligatorio." ToolTip="El tamaño es obligatorio." 
                ValidationGroup="LoginUserValidationGroup">*</asp:RequiredFieldValidator>

            </td>
        </tr>
        <tr>
            <td class="style1">
                <asp:Label ID="Label3" runat="server" AssociatedControlID="txtValor" >Ingrese el valor:</asp:Label>
            </td>
            <td>
               <asp:TextBox ID="txtValor" runat="server" MaxLength="4" ></asp:TextBox>
               <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtValor" 
                CssClass="failureNotification" ErrorMessage="El valor es obligatorio." ToolTip="El valor es obligatorio." 
                ValidationGroup="LoginUserValidationGroup">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="style1">
                <asp:Label ID="Label4" runat="server" AssociatedControlID ="txtTiempo">Ingrese el tiempo de elavoriación:</asp:Label>
            </td>
            <td>
               <asp:TextBox ID="txtTiempo" runat="server" MaxLength="2" ></asp:TextBox>
               <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtTiempo" 
                CssClass="failureNotification" ErrorMessage="El tiempo de elavoración es obligatorio." ToolTip="El tiempo de elavoración es obligatorio." 
                ValidationGroup="LoginUserValidationGroup">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        </table>
         <br />
         <br />
        <asp:Button ID="btnAceptaComandar" runat="server" Text="Aceptar" 
            onclick="btnAceptaComandar_Click" style="height: 26px" ValidationGroup="LoginUserValidationGroup" />
            
        <asp:Button ID="btnCancelarComanda" runat="server" Text="Cancelar" 
            onclick="btnCancelarComanda_Click"  style="height: 26px"/>
            
    
    </div>
    <asp:Label ID="lblError" runat="server" Text=""></asp:Label>
</asp:Content>